﻿# 设置Windows目标平台版本（兼容Win10及以上）
set(CMAKE_SYSTEM_VERSION 10.0.18362.0)

find_path(WTL_INCLUDE_DIRS "atlapp.h")

# 自动搜索当前目录下的所有.cpp文件
file(GLOB_RECURSE SOURCES "*.cpp" "*.hpp")

# 添加可执行文件
add_executable(GUIHookF3 WIN32  ${SOURCES})
target_compile_definitions(GUIHookF3 PRIVATE UNICODE _UNICODE)
target_include_directories(GUIHookF3 PRIVATE "${CMAKE_CURRENT_LIST_DIR}/include;${WTL_INCLUDE_DIRS}")

# 添加静态运行时库配置
if(MSVC)
    set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
    target_compile_options(GUIHookF3 PRIVATE /MT$<$<CONFIG:Debug>:d>)
endif()

# 原链接器配置保留
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFESTUAC:\"level='requireAdministrator'\"")

